﻿using B.S.Material.Domain.Scraps;
using B.S.Material.ErrorCode;
using B.S.Material.Read.Api.Applications.Command.ProductionWasteZCommand;
using B.S.Material.Read.Api.Applications.Command.ScrapBreakdownCommand;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;

namespace B.S.Material.Read.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProductionWasteZController : ControllerBase
    {
        private readonly IMediator mediator;
        private readonly ISqlSugarClient db;
        public ProductionWasteZController(IMediator mediator, ISqlSugarClient db)
        {
            this.mediator = mediator;
            this.db = db;
        }
        /// <summary>
        /// 生产退料显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ApiResult<ApiPaging<ProductionWasteZ>>> GetProductionWasteZ([FromQuery] GetProductionWasteZCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 生产退料反填
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ApiResult<List<ProductionWasteZ>>> FTProductionWasteZ([FromQuery] FTProductionWasteZCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 生产退料显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ApiResult<List<ScrapBreakdown>>> GetScrapBreakdown([FromQuery] GetScrapBreakdownCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 生产退料反填
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]

        public async Task<ApiResult<List<ScrapBreakdown>>> FTScrapBreakdown([FromQuery] FTScrapBreakdownCommand request)
        {
            return await mediator.Send(request);
        }


    }
}
